package Lirmm.VSM;


import java.util.StringTokenizer;
import java.util.Vector;


public class Divide {
	  public static String[] divideStringCapital(String str)
	   	{
	   		  char source[];
	   		  char s[]=str.toCharArray();
	   		  String ss []= new String[1];
	 		  
	   		  ss[0]=str;
	   		  int strSize=0;
	   		  
	   		  
	   		  //--------------------------------------------------------------------------
	   		  
	   		  for(int i=0;i<s.length; i++)
	   		  {
	   			 if(Character.isLetter(s[i]) && Character.isUpperCase(s[i]))
	   			  {
	   			
	   				 strSize+=1;
	   			 }
	   		  }
	   		  
	   		 //---------------------------------------------------------------------------- 
	   		  
	   		  
	   		  
	   		  
	   		  if (strSize==s.length)
	   			  
	   			  return ss;
	   		  else
	   		  {
//	   			  if(Character.isUpperCase(s[0]) && Character.isUpperCase(s[1]))
//	   				  
//	   		  	  {
//	   				  str=str.substring(1);
//	   				  
//	   				  
//	   			  }
	   			   
	   		  
	   		  
	   		  source= str.toCharArray();
	   		  String tempStr= "";
	   		  Vector<String> target = new Vector<String>();
	   		  for (int i=0; i< source.length; i++)
	   		  {
	   		       if(Character.isUpperCase(source[i]))
	   		        {
	   		    	 
	   			    
	   		            target.add(tempStr);
	   		            tempStr="";
	   			       tempStr += source[i];
	   		        }
	   		       else
	   		        {
	   		         tempStr += source[i];
	   		        }
	   		  }
	   		  
	   		  target.add(tempStr);
	   		  String result[] = new String[target.size()];
	   		  for (int i= 0; i< target.size(); i++)
	   			  
	   		    {
	   			 if (target.get(i)!=null)
				    {
			        result[i] = target.elementAt(i);
			        	        
	   		        }
	   		    }
	   		    return result;
	   		  } // end else
	   		  
	   		  
	   		  
	   		  }      
		         
	}

